<html><head>
<LINK rel=stylesheet type=text/css href="css/pui.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
</head>
<body>
<script language="JavaScript"> 
<!--
//http://www.douban.com/j/app/radio/people?app_name=radio_desktop_win&version=100&user_id=25807867&token=5e5f20e0ce&expire=1308642090&sid=&h=&channel=0&type=n
var resultInfo="";
var p_user_id="";
var p_token="";
var p_expire="";
var p_sid="";
var p_h="";

function a(){
var email = document.getElementById("pop_email").value;
var password= document.getElementById("pop_password").value;
var url="http://www.douban.com/j/app/login?email="+ email +"&password="+ password +"&app_name=radio_desktop_win&version=100";
test (url);
if(resultInfo.r=="0"){
    //
    p_user_id=resultInfo.user_id;
    p_token=resultInfo.token;
    p_expire=resultInfo.expire;
    alert("id"+p_user_id+" token"+p_token+" expire"+p_expire);
   //document.getElementById("login").style.visibility = "hidden";
   //document.getElementById("loginInfo").style.visibility = "hidden";
}if(resultInfo.r=="1"){
   document.getElementById("loginInfo").innerHTML="登入失败! 请检查用户名或密码。提示:"+resultInfo.err;
   document.getElementById("loginInfo").style.visibility = "visible";
}

}

var tid = 0;
function timeoutProc () {
    clearTimeout (tid);
    tid = 0;
    var status = psp.sysRadioGetHttpGetStatus ();
    switch ( status ) {
    case 0:
        var result = psp.sysRadioGetHttpGetResult ();
        psp.sysRadioHttpGetTerminate ();
        resultInfo=Convert .StringToJSON(result);
        break;
    case 1:
        tid = setTimeout ('timeoutProc ()', 500);
        break;
    default: // error
        psp.sysRadioHttpGetTerminate ();
        break;
    }
}
function test (url) {
    psp.sysRadioPrepareForHttpGet
        (url);
    if (tid == 0 ) tid = setTimeout ('timeoutProc ()', 500);
}

var Convert = {
    StringToJSON: function(str) {
        var a;
        eval('a=' + str + ';');
        return a; 
    }
};
// -->
</script>
<object name="psp" type="application/x-psp-extplugin"></object>
<div id="login">
<div class="hd">
<h3>
&nbsp;登录豆瓣FM
<span>
(
<a href="http://www.douban.com/accounts/register" target="_blank">还没有注册?</a>
)
</span>
</h3>
<div id="loginInfo">登入失败! 请检查用户名或密码</div>
</div>
<div class="item">
<label for="form_email">邮箱</label>
<input id="pop_email" class="text" type="email" name="email">
</div>
<div class="item">
<label for="form_password">密码</label>
<input id="pop_password" class="text" type="password" name="password">
</div>
<div class="item">
<label>&nbsp;</label>
<input id="remember" type="checkbox" name="remember">
<label class="sub" for="remember">下次自动登录 |</label>
<a style="margin-left: 0.8em;" tabindex="2" href="http://www.douban.com/accounts/resetpassword" target="_blank">忘记密码了</a>
</div>
<input type="hidden" value="radio_desktop_win" name="app_name">
<input type="hidden" value="100" name="version">
<div id="popsubmit">
<span class="bn-flat">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" onclick=a(); value="登录">
</span>
</div>
</div>
</body></html>